package com.youth.hrsync.config.batch;

import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.batch.core.launch.support.RunIdIncrementer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableBatchProcessing
public class HrBatchConfig extends DefaultBatchConfig {

    @Autowired
    Step delStep;

    @Autowired
    Step syncStep;

    @Bean(name = "hrJob")
    public Job hrJob() {
        return jobBuilderFactory.get("hrJob")
                .start(delStep)
                .next(syncStep)
                .incrementer(new RunIdIncrementer())
                .build()
        ;
    }

}
